package com.sbm.merge.设计模式.factory.simplefactory;

public class ShapeFactory {


    public static  Shape createShape(String shapeName){

        switch (shapeName.toLowerCase()) {
            case "circle":
                return new Circle();
            case "rectangle":
                return new Rectangle();
            default:
                throw new IllegalArgumentException("Invalid shape");
        }

    }

}
